home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / lang / SmallEiffel.lha / SmallEiffel / sys / gc_lib / linux.c < prev    next >
Encoding:
Text File  |  1998-12-22  |  1.1 KB  |  31 lines

  1. /*
  2. -- This file is  free  software, which  comes  along  with  SmallEiffel. This
  3. -- software  is  distributed  in the hope that it will be useful, but WITHOUT 
  4. -- ANY  WARRANTY;  without  even  the  implied warranty of MERCHANTABILITY or
  5. -- FITNESS  FOR A PARTICULAR PURPOSE. You can modify it as you want, provided
  6. -- this header is kept unaltered, and a notification of the changes is added.
  7. -- You  are  allowed  to  redistribute  it and sell it, alone or as a part of 
  8. -- another product.
  9. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  10. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  11. --                       http://www.loria.fr/SmallEiffel
  12. --
  13. */
  14. /* 
  15.    Stack and Registers traversal for PC Linux.
  16.    Addresses decrease as the stack grows.
  17.    Registers are saved using SETJMP().
  18. */
  19.  
  20. void mark_stack_and_registers(void) {
  21.   void** max = stack_bottom;
  22.   void** stack_pointer;
  23.   jmp_buf registers;
  24.  
  25.   (void)setjmp(registers);
  26.   stack_pointer=((void**)(®isters));
  27.   while(stack_pointer < max) {
  28.     gc_mark(*(stack_pointer++));
  29.   }
  30. }
  31.